$(function () {
    findById();
});

/**
 * 根据id查询权限信息
 */

function findById() {
    let id = sessionStorage.getItem("wordId");
    let result = myAjax("/api/dw/word/findById", {id: id}, "Post");
    if (result != null) {
        setData(result.data);
    }
}

function setData(data) {
    $("#english").val(data.english);
    $("#chinese").val(data.chinese);
}
function save() {
    let data={
        id:sessionStorage.getItem("wordId"),
        english:$("#english").val(),
        chinese:$("#chinese").val(),
    };
    let result = myAjax("/api/dw/word/update",data,"post");
    if(result.code===200){
        alert(result.data);
        x_admin_close();
        x_admin_father_reload();
    }else{
        alert(result.data);
    }
}